import { LogTag, Optional, _appInfo2 } from "CoffeeSdk";
import { Node } from "../lib/CommonMark";


export function printNodeDeepInfo(node: Node, tags: LogTag[]) {
  const walker = node.walker();
  let n: Optional<Node> = undefined;
  do {
    n = walker.next()?.node;
    if (n) {
      printNodeInfo(n, tags);
    }
  } while (n)
}

export function printNodeInfo(node: Node, tags: LogTag[]) {
  _appInfo2(`t:${node.type}|c:${node.content}|t:${node.title}|literal:${node.literal}`, { tags: tags });
}